#ifndef __BASICOPS
#define __BASICOPS

#include <stdlib.h>
#include <iostream>
#include <cuda_runtime.h>



using namespace std;

__global__ void add(int* a, int* b, int* c);

int main(int*argc, void**argv) {
	cout << "hi\n";
	int *h_a;
	*h_a = 5;
	int *h_b;
	*h_b = 8;
	int *h_c;

	int *d_a;
	int* d_b;
	int* d_c;

	cudaMalloc((void**) &d_a, sizeof(int));
	cudaMalloc((void**) &d_b, sizeof(int));
	cudaMalloc((void**) &d_c, sizeof(int));

	cudaMemcpy(&d_a, &h_a, sizeof(int), cudaMemcpyHostToDevice);
	cudaMemcpy(&d_b, &h_b, sizeof(int), cudaMemcpyHostToDevice);
	cudaMemcpy(&d_c, &h_c, sizeof(int), cudaMemcpyHostToDevice);


	add<<<1, 1>>>(&d_a, &d_b, &d_c);

	cudaMemcpy(&d_c, &h_c, sizeof(int), cudaMemcpyDeviceToHost);

	cout << "it's: "<<*d_c << endl;
	
	system("pause");




}

__global__ void add (int* a, int*b, int*c) {
	*c = *a + *b;
}

#endif